package org.example.pet.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    //用户ID
    @TableId(value="user_id", type = IdType.AUTO)
    private Long userId;
    //用户名
    private String username;
    //密码
    private String password;
    //邮箱
    private String email;
    //手机号
    private String phone;
    //地址
    private String address;
    //角色：ADMIN-管理员，USER：普通用户
    private String role;
    //状态：ACTIVE-激活，INACTIVE-禁用
    private String status;
    //创建时间
    private LocalDateTime createdAt;
    //更新时间
    private LocalDateTime updatedAt;
    
    public enum RoleVal {
        ADMIN("ADMIN", "管理员"),
        USER("USER", "普通用户"),
        ;

        private String val;
        private String desc;

        RoleVal(String val, String desc) {
            this.val = val;
            this.desc = desc;
        }

        public String getVal() {
            return val;
        }

        public String getDesc() {
            return desc;
        }
    }
    
    public enum StatusVal {
        ACTIVE("ACTIVE", "激活"),
        INACTIVE("INACTIVE", "禁用"),
        ;

        private String val;
        private String desc;

        StatusVal(String val, String desc) {
            this.val = val;
            this.desc = desc;
        }

        public String getVal() {
            return val;
        }

        public String getDesc() {
            return desc;
        }
    }
}
